﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace NeuralStock.Tests
{
    public static class TestHelper
    {
        private const decimal epsilon = 0.01m;

        public static void CheckErrorBelowEpsilon(decimal? actual, decimal? expected, string message)
        {
            decimal? error;

            error = Math.Abs(actual.Value / expected.Value - 1m);
            Assert.IsTrue(error < epsilon, message);
        }
    }
}
